clear 
set more off 

//cd <>
//use "Data_Idol_Paper.dta"



*************Results and Analysis************* 

global X_imbalance urban news
global X_full age female edu



********************************************************************************
*** Main Table I: Priming experiment and effect of corrections 
********************************************************************************

{

eststo clear

**Model 1:  Feelings Towards Religious Outgroup**

reg feel_outgroup i.treat_ft $X_full, robust
est store   M1

**Model 2: Feelings Towards Religious Ingroup**
reg feel_ingroup i.treat_ft  $X_full, robust
est store M2

**Model 3: Polarization, Feelings Difference Ingroup minus Outgroup**
reg feel_inminusout i.treat_ft  $X_full, robust
est store M3

**Model 4: Feelings Towards Religious Outgroup with Any Correction**
reg feel_outgroup i.treat_idol_any $X_full if treat_ft==1, robust
est store M4

**Model 5: Feelings Towards Religious Outgroup with Disaggregated Correction**
reg feel_outgroup treat_idol_correct treat_idol_priest $X_full if treat_ft==1, robust
est store M5

**Generate Table I. Priming experiment and effect of corrections
estout M1 M2 M3 M4 M5 , style(tex)  cells( b(star fmt(%9.3f) label(Coef.)) se(label(Std. err.) par) )  stats(r2 r2_a N, fmt(%9.3f %9.0g) labels(R-squared Adjusted R2)) legend label collabels(none) varlabels(_cons Constant) starlevels($^\dag$ 0.10 * 0.05 ** 0.01 *** 0.001) keep(1.treat_ft age female edu 1.treat_idol_any treat_idol_correct treat_idol_priest  _cons)

}


********************************************************************************
***Main Table II:  Priming experiment, heterogenous treatment effects 
********************************************************************************

{
eststo clear

**Model 1: Outgroup: Misinformation with Hindu interaction**
reg feel_outgroup i.treat_ft##i.resp_hindu  $X_full , robust
est store H1 
/*
**To generate Figure 3a, by religious identity 
margins, at(treat_ft=(0 1) resp_hindu=(0 1) ) atmeans 
marginsplot, recast(scatter) legend(order( 3 "non-Hindu" 4 "Hindu") pos(6) row(1)) xsize(5) title("By religious identity", size(medsmall)) legend(region(lwidth(none))) legend(region(lwidth(none))) ylabel(35(5)90) graphregion(color(white)) bgcolor(white) ytitle("Feelings towards outgroups") fxsize(38)
graph save "Graph" "Temp1_RR.gph", replace 
*/

	

**Model 2: Outgroup: Misinformation with BJP interaction**
reg feel_outgroup i.treat_ft##i.vote_bjp $X_full, robust
est store H2
/*
**To generate Figure 3b, by partisanship 
margins, at(treat_ft=(0 1) vote_bjp=(0 1) ) atmeans 
marginsplot, recast(scatter) legend(order( 3 "non-BJP" 4 "BJP") pos(6) row(1)) xsize(5) title("By partisanship", size(medsmall)) legend(region(lwidth(none))) legend(region(lwidth(none))) ylabel(35(5)90) graphregion(color(white)) bgcolor(white) ytitle("Feelings towards outgroups") fxsize(29)
graph save "Graph" "Temp2_RR.gph", replace 
*/



**Model 3: Outgroup: Misinformation with Hindu and BJP interaction**
reg feel_outgroup i.treat_ft##i.vote_bjp##i.resp_hindu $X_full, robust
est store H3
/*
**To generate Figure 3c, by religious identity and partisanship
margins , at(treat_ft=(0 1) resp_hindu=(0 1) vote_bjp=(0 1) ) atmeans 
marginsplot, recast(scatter) legend(order( 5 "non-Hindu, non-BJP" 6 "Hindu, non-BJP" 8 "Hindu, BJP") pos(6) row(1)) xsize(5) title("By religious identity and partisanship", size(medsmall)) legend(region(lwidth(none))) legend(region(lwidth(none))) ylabel(35(5)90) graphregion(color(white)) bgcolor(white) ytitle("Feelings towards outgroups") plot3opts(lc(none) mc(none)) ci3opts(col(none))  fxsize(33)
graph save "Graph" "Temp3_RR.gph", replace 
*/


**Model 4: Outgroup: Correction with Hindu interaction**
reg feel_outgroup i.treat_idol_any##i.resp_hindu $X_full if treat_ft==1, robust
est store H4


**Model 5: Outgroup: Correction with BJP interaction**
reg feel_outgroup i.treat_idol_any##i.vote_bjp $X_full if treat_ft==1, robust
est store H5

**Model 6: Outgroup: Correction with BJP and Hindu interaction**
reg feel_outgroup i.treat_idol_any##i.vote_bjp##i.resp_hindu $X_full if treat_ft==1, robust
est store H6

**Generate Table II. Priming experiment, heterogenous treatment effects
estout H1 H2 H3 H4 H5 H6 , style(tex)  cells( b(star fmt(%9.3f) label(Coef.)) se(label(Std. err.) par) )  stats(r2 r2_a N, fmt(%9.3f %9.0g) labels(R-squared Adjusted R2)) legend label collabels(none) varlabels(_cons Constant) starlevels($^\dag$ 0.10 * 0.05 ** 0.01 *** 0.001) keep(1.treat_idol_any 1.treat_ft 1.vote_bjp 1.resp_hindu 1.treat_ft#1.resp_hindu 1.treat_ft#1.vote_bjp 1.treat_idol_any#1.vote_bjp 1.treat_idol_any#1.resp_hindu 1.vote_bjp#1.resp_hindu 1.treat_idol_any#1.vote_bjp#1.resp_hindu 1.treat_ft#1.vote_bjp#1.resp_hindu age female edu _cons)


**To generate Figure 3. Exposure to misinformation and feelings towards outgroup
/*
graph combine Temp1_RR.gph Temp2_RR.gph Temp3_RR.gph , col(3)
*/

}




********************************************************************************
***Main Table III Mediation analysis 
********************************************************************************

{
eststo clear
eststo: medeff (regress misinformed treat_ft resp_hindu vote_bjp age female edu) (regress feel_outgroup treat_ft misinformed resp_hindu vote_bjp age female edu), mediate(misinformed) treat(treat_ft) sims(1000) 	
}






********************************************************************************
********************************************************************************
***APPENDIX 
********************************************************************************
********************************************************************************




********************************************************************************
***Appendix D. Balance Test 
********************************************************************************
{
gen 	treatment = 0
replace treatment = 1 if treat_ft==1 & treat_idol_correct==0 & treat_idol_priest==0
replace	treatment = 2 if treat_idol_correct==1
replace	treatment = 3 if treat_idol_priest==1
eststo clear

mlogit	treatment resp_* age income vote_bjp  female urban news socialmedia, base(0) 
est store balance

/*
esttab balance using balance_idol_RR.tex,  ///
replace scalars("ll Log lik." "chi2 Chi-squared") se label  b(%9.3f) t(%9.3f) nonumber booktabs ///
title("Covariate balance." \label{tab:balance}) ///
mtitle("M1") ///
eqlabels(none) ///
mgroups("Treatment Assignment", pattern(1) ///
prefix(\multicolumn{@span}{c}{) suffix(})   ///
span erepeat(\cmidrule(lr){@span}))         ///
alignment(cr) page(dcolumn) nonumber compress
*/
drop treatment 
}



********************************************************************************
***Appendix F. Replicating Table I: Priming Experiment 
********************************************************************************
{


*** Table F.1. Priming experiment, average treatment effects (baseline models)
{

eststo clear
**Model 1:  Feelings Towards Religious Outgroup**
reg feel_outgroup i.treat_ft , robust
est store   M1

**Model 2:  Feelings Towards Religious Ingroup**
reg feel_ingroup i.treat_ft  , robust
est store M2

**Model 3: Polarization, Feelings Difference Ingroup minus Outgroup**
reg feel_inminusout i.treat_ft  , robust
est store M3

estout M1 M2 M3, style(tex)  cells( b(star fmt(%9.3f) label(Coef.)) se(label(Std. err.) par) )  stats(r2 r2_a N, fmt(%9.3f %9.0g) labels(R-squared Adjusted R2)) legend label collabels(none) varlabels(_cons Constant) starlevels($^\dag$ 0.10 * 0.05 ** 0.01 *** 0.001) 

}



*** Table F.2. Priming experiment, with alternative DV: New neighbor
{
eststo clear

**Model 1:  Feelings Towards Religious Outgroup**
reg feel_newoutgroup i.treat_ft $X_full, robust
est store   M1

**Model 2:  Feelings Towards Religious Ingroup**
reg feel_newingroup i.treat_ft  $X_full, robust
est store M2

**Model 3: Polarization, Feelings Difference Ingroup minus Outgroup**
reg feel_new_inminusout i.treat_ft  $X_full, robust
est store M3

**Model 4: Outgroup: Misinformation with Hindu interaction**
eststo: reg feel_newoutgroup i.treat_ft##i.resp_hindu  $X_full , robust
est store M4 

**Model 5: Outgroup: Misinformation with BJP interaction**
reg feel_newoutgroup i.treat_ft##i.vote_bjp $X_full, robust
est store M5

** Model 6: Outgroup: Misinformation with BJP and Hindu interaction**
reg feel_newoutgroup i.treat_ft##i.vote_bjp##i.resp_hindu $X_full, robust
est store M6

estout M1 M2 M3 M4 M5 M6  , style(tex)  cells( b(star fmt(%9.3f) label(Coef.)) se(label(Std. err.) par) )  stats(r2 r2_a N, fmt(%9.3f %9.0g) labels(R-squared Adjusted R2)) legend label collabels(none) varlabels(_cons Constant) starlevels($^\dag$ 0.10 * 0.05 ** 0.01 *** 0.001) keep(1.treat_ft  1.vote_bjp 1.resp_hindu 1.treat_ft#1.vote_bjp 1.treat_ft#1.resp_hindu 1.vote_bjp#1.resp_hindu 1.treat_ft#1.vote_bjp#1.resp_hindu age female edu _cons)
}



*** Table F.3. Priming experiment, heterogenous treatment effects with DC: Ingroups
{
eststo clear

**Model 1: Ingroup: Misinformation with Hindu interaction**
eststo: reg feel_ingroup i.treat_ft##i.resp_hindu  $X_full , robust
est store M1 

**Model 2:  Ingroup: Misinformation with BJP interaction**
reg feel_ingroup i.treat_ft##i.vote_bjp $X_full, robust
est store M2

** Model 3: Ingroup: Misinformation with BJP and Hindu interaction**
reg feel_ingroup i.treat_ft##i.vote_bjp##i.resp_hindu $X_full, robust
est store M3

estout M1 M2 M3  , style(tex)  cells( b(star fmt(%9.3f) label(Coef.)) se(label(Std. err.) par) )  stats(r2 r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons Constant) starlevels($^\dag$ 0.10 * 0.05 ** 0.01 *** 0.001) keep(1.treat_ft  1.vote_bjp 1.resp_hindu 1.treat_ft#1.vote_bjp 1.treat_ft#1.resp_hindu 1.vote_bjp#1.resp_hindu 1.treat_ft#1.vote_bjp#1.resp_hindu age female edu _cons)
}



*** Table F.4. Priming experiment, heterogenous treatment effects with DC: Polarization
{

eststo clear

**Model 1: Polarization: Misinformation with Hindu interaction**
eststo: reg feel_inminusout i.treat_ft##i.resp_hindu  $X_full , robust
est store M1 

**Model 2: Polarization: Misinformation with BJP interaction**
reg feel_inminusout i.treat_ft##i.vote_bjp $X_full, robust
est store M2

** Model 3: Polarization: Misinformation with BJP and Hindu interaction**
reg feel_inminusout i.treat_ft##i.vote_bjp##i.resp_hindu $X_full, robust
est store M3

estout M1 M2 M3  , style(tex)  cells( b(star fmt(%9.3f) label(Coef.)) se(label(Std. err.) par) )  stats(r2 r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons Constant) starlevels($^\dag$ 0.10 * 0.05 ** 0.01 *** 0.001) keep(1.treat_ft  1.vote_bjp 1.resp_hindu 1.treat_ft#1.vote_bjp 1.treat_ft#1.resp_hindu 1.vote_bjp#1.resp_hindu 1.treat_ft#1.vote_bjp#1.resp_hindu age female edu _cons)
}

}



********************************************************************************
***Appendix G. Replicating Table I: Effect of corrections
********************************************************************************
{
*** Table G.1. Priming experiment, effect of corrections with DV: Ingroups
{ 
eststo clear

**Model 1: Feelings Towards Religious Ingroup with Any Correction**
reg feel_ingroup i.treat_idol_any $X_full if treat_ft==1, robust
est store MA

**Model 2: Feelings Towards Religious Ingroup with Disaggregated Correction**
eststo: reg feel_ingroup treat_idol_correct treat_idol_priest $X_full if treat_ft==1, robust
est store MB

**Model 3: Ingroup: Correction with Hindu interaction**
reg feel_ingroup i.treat_idol_any##i.resp_hindu $X_full if treat_ft==1, robust
est store MC

**Model 4: Ingroup: Correction with BJP interaction**
reg feel_ingroup i.treat_idol_any##i.vote_bjp $X_full if treat_ft==1, robust
est store MD

** Model 5: Ingroup: Correction with BJP and Hindu interaction**
reg feel_ingroup i.treat_idol_any##i.vote_bjp##i.resp_hindu $X_full if treat_ft==1, robust
est store ME

estout MA MB MC MD ME , style(tex)  cells( b(star fmt(%9.3f) label(Coef.)) se(label(Std. err.) par) )  stats(r2 r2_a N, fmt(%9.3f %9.0g) labels(R-squared Adjusted R2)) legend label collabels(none) varlabels(_cons Constant) starlevels($^\dag$ 0.10 * 0.05 ** 0.01 *** 0.001) keep(1.treat_idol_any treat_idol_correct treat_idol_priest 1.vote_bjp 1.resp_hindu 1.treat_idol_any#1.vote_bjp 1.treat_idol_any#1.resp_hindu 1.vote_bjp#1.resp_hindu 1.treat_idol_any#1.vote_bjp#1.resp_hindu age female edu _cons)
}



*** Table G.2. Priming experiment, effect of corrections with DV: Polarization
{ 
eststo clear

**Model 1: Polarization with Any Correction**
reg feel_inminusout i.treat_idol_any $X_full if treat_ft==1, robust
est store MA

**Model 2: Polarization  with Disaggregated Correction**
eststo: reg feel_inminusout treat_idol_correct treat_idol_priest $X_full if treat_ft==1, robust
est store MB

**Model 3: Polarization: Correction with Hindu interaction**
reg feel_inminusout i.treat_idol_any##i.resp_hindu $X_full if treat_ft==1, robust
est store MC

**Model 4: Polarization: Correction with BJP interaction**
reg feel_inminusout i.treat_idol_any##i.vote_bjp $X_full if treat_ft==1, robust
est store MD

** Model 5: Polarization: Correction with BJP and Hindu interaction**
reg feel_inminusout i.treat_idol_any##i.vote_bjp##i.resp_hindu $X_full if treat_ft==1, robust
est store ME

estout MA MB MC MD ME , style(tex)  cells( b(star fmt(%9.3f) label(Coef.)) se(label(Std. err.) par) )  stats(r2 r2_a N, fmt(%9.3f %9.0g) labels(R-squared Adjusted R2)) legend label collabels(none) varlabels(_cons Constant) starlevels($^\dag$ 0.10 * 0.05 ** 0.01 *** 0.001) keep(1.treat_idol_any treat_idol_correct treat_idol_priest 1.vote_bjp 1.resp_hindu 1.treat_idol_any#1.vote_bjp 1.treat_idol_any#1.resp_hindu 1.vote_bjp#1.resp_hindu 1.treat_idol_any#1.vote_bjp#1.resp_hindu age female edu _cons)
}



*** Table G.3. Disaggregating effect of coorections by religion and partisanship
{
eststo clear

**Model 1: Outgroup: Interaction between generic correction and Hindu**
reg feel_outgroup i.treat_idol_correct##i.resp_hindu i.treat_idol_priest $X_full if treat_ft==1, robust
est store ACorrA

**Model 2: Outgroup: Interaction between generic correction and BJP**
reg feel_outgroup i.treat_idol_correct##i.vote_bjp i.treat_idol_priest $X_full if treat_ft==1, robust
est store ACorrB

**Model 3: Outgroup: Interaction between generic correction, Hindu, and BJP**
reg feel_outgroup i.treat_idol_correct##i.resp_hindu##i.vote_bjp i.treat_idol_priest $X_full if treat_ft==1, robust
est store ACorrAB

**Model 4: Outgroup: Interaction between priest correction and Hindu**
reg feel_outgroup i.treat_idol_priest##i.resp_hindu i.treat_idol_correct $X_full if treat_ft==1, robust
est store ACorrC

**Model 5: Outgroup: Interaction between priest correction and BJP**
reg feel_outgroup i.treat_idol_priest##i.vote_bjp i.treat_idol_correct $X_full if treat_ft==1, robust
est store ACorrD

**Model 6: Outgroup: Interaction between priest correction, Hindu, and BJP**
reg feel_outgroup i.treat_idol_priest##i.resp_hindu##i.vote_bjp i.treat_idol_correct $X_full if treat_ft==1, robust
est store ACorrCD

estout ACorrA ACorrB ACorrAB ACorrC ACorrD ACorrCD , style(tex)  cells( b(star fmt(%9.3f) label(Coef.)) se(label(Std. err.) par) )  stats(r2 r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons Constant) starlevels($^\dag$ 0.10 * 0.05 ** 0.01 *** 0.001) keep(1.treat_idol_correct 1.treat_idol_priest 1.treat_idol_priest#1.resp_hindu 1.treat_idol_correct#1.resp_hindu 1.treat_idol_correct#1.resp_hindu#1.vote_bjp 1.treat_idol_priest#1.vote_bjp 1.treat_idol_correct#1.vote_bjp 1.resp_hindu 1.vote_bjp 1.treat_idol_priest#1.resp_hindu#1.vote_bjp age female edu 1.resp_hindu#1.vote_bjp _cons)
}




*** Figure G.1. Feelings towards outgroups

**To generate Figure G.1a. Feelings towards outgroups, By religion
/*
reg feel_outgroup i.treat_idol_any##i.resp_hindu  $X_full if treat_ft==1, robust
margins, at(treat_idol_any=(0) resp_hindu=(0 1) ) atmeans 
marginsplot, recast(scatter) legend(order( 3 "Muslim" 4 "Hindu") pos(6) row(1)) xsize(5) title("", size(medsmall)) legend(region(lwidth(none))) ylabel(45(5)70) ytitle("Feelings towards outgroups") xtitle("")
graph save "Graph" "C:\Users\nprasad\Dropbox\Idol experiment\Data\Temp1.gph", replace 

reg feel_outgroup i.treat_idol_correct##i.resp_hindu i.treat_idol_priest $X_full if treat_ft==1, robust
margins, at(treat_idol_correct=(1) resp_hindu=(0 1) ) atmeans 
marginsplot, recast(scatter) legend(order( 3 "Muslim" 4 "Hindu") pos(6) row(1)) xsize(5) title("", size(medsmall)) legend(region(lwidth(none))) ylabel(45(5)70) ytitle("") xtitle("")
graph save "Graph" "C:\Users\nprasad\Dropbox\Idol experiment\Data\Temp2.gph", replace 

reg feel_outgroup i.treat_idol_priest##i.resp_hindu i.treat_idol_correct $X_full if treat_ft==1, robust
margins, at(treat_idol_priest=(1) resp_hindu=(0 1) ) atmeans 
marginsplot, recast(scatter) legend(order( 3 "Muslim" 4 "Hindu") pos(6) row(1)) xsize(5) title("", size(medsmall)) legend(region(lwidth(none))) ylabel(45(5)70) ytitle("") xtitle("")
graph save "Graph" "C:\Users\nprasad\Dropbox\Idol experiment\Data\Temp3.gph", replace 

graph combine Temp1.gph Temp2.gph Temp3.gph , col(3)
*/


**To generate Figure G.1b. Feelings towards outgroups, By partisan affiliation
/*
reg feel_outgroup i.treat_idol_any##i.vote_bjp  $X_full if treat_ft==1, robust
margins, at(treat_idol_any=(0) vote_bjp=(0 1) ) atmeans 
marginsplot, recast(scatter) legend(order( 3 "Non BJP" 4 "BJP") pos(6) row(1)) xsize(5) title("", size(medsmall)) legend(region(lwidth(none))) ylabel(35(5)60) ytitle("Feelings towards outgroups") xtitle("")
graph save "Graph" "C:\Users\nprasad\Dropbox\Idol experiment\Data\Temp1.gph", replace 

reg feel_outgroup i.treat_idol_correct##i.vote_bjp i.treat_idol_priest $X_full if treat_ft==1, robust
margins, at(treat_idol_correct=(1) vote_bjp=(0 1) ) atmeans 
marginsplot, recast(scatter) legend(order( 3 "Non BJP" 4 "BJP") pos(6) row(1)) xsize(5) title("", size(medsmall)) legend(region(lwidth(none))) ylabel(35(5)60) ytitle("") xtitle("")
graph save "Graph" "C:\Users\nprasad\Dropbox\Idol experiment\Data\Temp2.gph", replace 

reg feel_outgroup i.treat_idol_priest##i.vote_bjp i.treat_idol_correct $X_full if treat_ft==1, robust
margins, at(treat_idol_priest=(1) vote_bjp=(0 1) ) atmeans 
marginsplot, recast(scatter) legend(order( 3 "Non BJP" 4 "BJP") pos(6) row(1)) xsize(5) title("", size(medsmall)) legend(region(lwidth(none))) ylabel(35(5)60) ytitle("") xtitle("")
graph save "Graph" "C:\Users\nprasad\Dropbox\Idol experiment\Data\Temp3.gph", replace 

graph combine Temp1.gph Temp2.gph Temp3.gph , col(3)
*/


}



********************************************************************************
***Appendix H. Effect of corrections on perceived accuracy
********************************************************************************
{

*** Table H.1. Effect of corrections on reported accuracy of misinformation message
{ 
eststo clear

**Model 1: Generic correction interaction with Hindu**
reg perc_accurate i.treat_idol_correct##i.resp_hindu i.treat_idol_priest $X_full treat_ft , robust
est store ACorrA

**Model 2: Generic correction interaction with BJP**
reg perc_accurate i.treat_idol_correct##i.vote_bjp i.treat_idol_priest $X_full  treat_ft , robust
est store ACorrB

**Model 3: Priest correction interaction with Hindu**
reg perc_accurate i.treat_idol_priest##i.resp_hindu i.treat_idol_correct $X_full treat_ft , robust
est store ACorrD

**Model 4: Priest correction interaction with BJP**
reg perc_accurate i.treat_idol_priest##i.vote_bjp i.treat_idol_correct $X_full treat_ft , robust
est store ACorrE

estout ACorrA ACorrB  ACorrD  ACorrE  , style(tex)  cells( b(star fmt(%9.3f) label(Coef.)) se(label(Std. err.) par) )  stats(r2 r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons Constant) starlevels($^\dag$ 0.10 * 0.05 ** 0.01 *** 0.001) keep(1.treat_idol_correct 1.treat_idol_priest 1.treat_idol_priest#1.resp_hindu 1.treat_idol_correct#1.resp_hindu 1.treat_idol_priest#1.vote_bjp 1.treat_idol_correct#1.vote_bjp  1.resp_hindu 1.vote_bjp  age female edu treat_ft _cons)
}



*** Table H.2. Effect of corrections on propensity to share/forward misinformation message
{ 
eststo clear

**Model 1: Generic correction interaction with Hindu**
reg mes_forward i.treat_idol_correct##i.resp_hindu i.treat_idol_priest $X_full treat_ft , robust
est store ACorrA

**Model 2: Generic correction interaction with BJP**
reg mes_forward i.treat_idol_correct##i.vote_bjp i.treat_idol_priest $X_full  treat_ft , robust
est store ACorrB

**Model 3: Priest correction interaction with Hindu**
reg mes_forward i.treat_idol_priest##i.resp_hindu i.treat_idol_correct $X_full treat_ft , robust
est store ACorrC

**Model 4: Priest correction interaction with BJP**
reg mes_forward i.treat_idol_priest##i.vote_bjp i.treat_idol_correct $X_full treat_ft , robust
est store ACorrD

estout ACorrA ACorrB ACorrC ACorrD  , style(tex)  cells( b(star fmt(%9.3f) label(Coef.)) se(label(Std. err.) par) )  stats(r2 r2_a N, fmt(%9.3f %9.0g) labels(R-squared)) legend label collabels(none) varlabels(_cons Constant) starlevels($^\dag$ 0.10 * 0.05 ** 0.01 *** 0.001) keep(1.treat_idol_correct 1.treat_idol_priest 1.treat_idol_priest#1.resp_hindu 1.treat_idol_correct#1.resp_hindu 1.treat_idol_priest#1.vote_bjp 1.treat_idol_correct#1.vote_bjp 1.resp_hindu 1.vote_bjp age female edu treat_ft _cons)
}
}



********************************************************************************
***Appendix I. Mediation analysis
********************************************************************************
{
*** Table I.1. Mediation analysis; Full Model for Table III
{
eststo clear
eststo: medeff (regress misinformed treat_ft resp_hindu vote_bjp age female edu) (regress feel_outgroup treat_ft misinformed resp_hindu vote_bjp age female edu), mediate(misinformed) treat(treat_ft) sims(1000) 	
}



*** Table I.2. Mediation analysis: Alternate specifications 
{
*** For Column AM1, Table I.2. Mediation analysis; Full Model for Table III
preserve
keep if treat_ft==0 | control_idol ==1
eststo: medeff (regress misinformed treat_ft resp_hindu vote_bjp age female edu) (regress feel_outgroup treat_ft misinformed resp_hindu vote_bjp age female edu), mediate(misinformed) treat(treat_ft) sims(1000)
restore 


*** For Column AM2, Table I.2. Mediation analysis; Full Model for Table III
eststo: medeff (regress emisinformed treat_ft resp_hindu vote_bjp age female edu) (regress feel_outgroup treat_ft emisinformed resp_hindu vote_bjp age female edu), mediate(emisinformed) treat(treat_ft) sims(1000) 	
 

*** For Column AM3, Table I.2. Mediation analysis; Full Model for Table III
eststo: medeff (regress smisinformed treat_ft resp_hindu vote_bjp age female edu) (regress feel_outgroup treat_ft smisinformed resp_hindu vote_bjp age female edu), mediate(smisinformed) treat(treat_ft) sims(1000)



*** For Column AM4, Table I.1. Mediation analysis; Full Model for Table III
//program drop _all 
//program define deboot, rclass
//#delimit ;
regress feel_outgroup treat_ft misinformed resp_hindu vote_bjp age female edu;
gen ytilde = feel_outgroup - _b[misinformed];
reg ytilde treat_ft  resp_hindu vote_bjp age female edu;
//return scalar deffect = _b[treat_ft];
//#delimit cr
//end
//bootstrap deffect=r(deffect), reps(1000) seed(12345): deboot
}


*** To generate Figure I.2: Sequential Unconfoundedness
//drop if misinformed==. | treat_ft==. | resp_hindu==. | vote_bjp==. | age==. | female==. | edu==. | feel_outgroup==.
/*
//Code for Figure I.2: Sequential Unconfoundedness
medsens (regress misinformed treat_ft resp_hindu vote_bjp age female edu) (regress feel_outgroup treat_ft misinformed resp_hindu vote_bjp age female edu), mediate(misinformed) treat(treat_ft) sims(1000) 	
twoway rarea _med_updelta0 _med_lodelta0 _med_rho, bcolor(gs14) || line _med_delta0 _med_rho , lcolor(black) ytitle("Average mediation effect") xtitle("Sensitivity parameter: p") legend(off) title("ACME(p)") 

//The "medsens" command generates a graph with x-axis spanning from p=-1 to p=+1. In order to focus only on the region where mediated effects turn zero, Figure I2 only includes a part of the x-axis from p=-0.4 to p=+0.4; it also excludes the CI plot. The goal is to illustrate that from small values of p (correlation), the mediation effect is zero.  

*/
}

